import java.io.*;
import java.net.Socket;
import java.util.Scanner;

public class TestSQL {
    public static void main(String[] args) {
        Socket client = null;
        try {
            client = new Socket("127.0.0.1", 8889);
            PrintWriter outLocal = new PrintWriter(System.out,true);
            outLocal.println("已链接" + client.getRemoteSocketAddress());
            Scanner in = new Scanner(client.getInputStream());
//            while (in.hasNextLine()) {//这里阻塞
//                String got = in.nextLine();
//                outLocal.println(got);
//            }
//            OutputStream out = client.getOutputStream();
            int[] send = {
                    0x50,0x00,0x00,0x01,0x85,0xa6,0x0f,0x00,
                    0x00,0x00,0x00,0x01,0x21,0x00,0x00,0x00,
                    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
                    0x00,0x00,0x00,0x00,0x74,0x65,0x73,0x74,
                    0x00,0x14,0xc5,0x62,0xca,0xe8,0xc6,0x8c,
                    0x15,0xd6,0xa7,0xdb,0x08,0x6e,0x14,0xc8,
                    0x97,0x08,0xcf,0x38,0x0a,0x97,0x6d,0x79,
                    0x73,0x71,0x6c,0x5f,0x6e,0x61,0x74,0x69,
                    0x76,0x65,0x5f,0x70,0x61,0x73,0x73,0x77,
                    0x6f,0x72,0x64,0x00
            };
            for (int aSend : send) {
//                out.write(aSend);
                outLocal.print(aSend);
            }
        } catch (IOException e) {
            System.out.println("链接错误");
            e.printStackTrace();
        }
    }
}